var config = require("../config/index");
var randomUtils = require("./utils/randomUtils");
var logUtils = require("./utils/logUtils");
var baiDuJiSu = require("./apps/baiDuJiSu/index");
var xiGua = require("./apps/xiGua/index");

var apps = [
  //prettier-ignore
  baiDuJiSu,
  xiGua,
];
function start() {
  while (true) {
    for (var index = 0; index < apps.length; index++) {
      var app = apps[index];
      var isIgnoreApp = config.ignoreApps.find((ignoreApp) => {
        return ignoreApp == app.name;
      });
      if (isIgnoreApp) {
        console.log(`${app.name} is ignore`);
        logUtils.log(app.name + "被跳过");
      } else {
        app.main();
      }
      sleep(randomUtils.getRandom(2, 3, 1000));
    }
  }
}

start();
